Notebook criado para determinar:

  • Em qual ponto do HRD a estrela perde todo o hidrogênio em sua composição
  • Massa do nucleo de He no final da queima de H
  • Perda de massa
  • Analisar as posicoes antes e depois dos pulsos termicos

Sendo que a estrela foi evoluida utilizando o teste make_o_ne_wd do test_suite do MESA-r8845 com as seguintes modificações:

  1. Rotação desligada (parametros ..rotation_flag e ...v_flag comentados)
  2. Difusão de elementos ligada (do_element_diffusion = .true.)
  3. $\alpha_{MLT} = 2$ (comentado o parametro gradT_excesslambda1 que define $\alpha{MLT}=1$ para toda a estrela)
  4. Massa inicial $9 M_\odot$

Os resultados do teste se encontram na pasta /media/glauffer/Data/mesa/alpha2_r8845

Lendo os dados salvos pelo MESA


In [1]:
import mesa as ms

# Pasta com os resultados do MESA

folder = '/media/glauffer/Data/mesa/alpha2_r8845/LOGS'

# Ler os dados do history

s = ms.history_data(folder)

# Extraindo massa, idade e modelo

mass = s.get('star_mass')
age = s.get('star_age')
model = s.get('model_number')


Using old history.datasa file ...
 reading ...100% 

Calculando a concentração média de H ao longo da evolução da estrela


In [10]:
# Foi calculado com um script separado para não travar o notebook.
# O script está em /home/glauffer/Documents/mesa/codes/element_minimun.py

# Load dos dados de modelos e media do H:
import numpy as np
models = np.loadtxt('/media/glauffer/Data/mesa/alpha2_r8845/models.txt')
mean_elem = np.loadtxt('/media/glauffer/Data/mesa/alpha2_r8845/mean_elem.txt')

# Modelo com minimo de H
model[np.argmin(mean_elem)]

#plot mean_elem vs models
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(models, mean_elem)
plt.plot(model[np.argmin(mean_elem)], 0, 'ro')


Out[10]:
[<matplotlib.lines.Line2D at 0x7ffbacabd1d0>]

In [17]:
# Zoom no plot entre a região 2000 e model[np.argmin(mean_elem)]
minimo = model[np.argmin(mean_elem)]
plt.plot(models, mean_elem)
plt.xlim(2000, minimo)
print mean_elem[2000:2225]


[  2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.81509128e-01   2.81509128e-01   2.81509128e-01   2.81509128e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.80973179e-01   2.80973179e-01
   2.80973179e-01   2.80973179e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   2.33395843e-01   2.33395843e-01   2.33395843e-01   2.33395843e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   1.73468352e-01   1.73468352e-01
   1.73468352e-01   1.73468352e-01   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   4.09531919e-08   4.09531919e-08   4.09531919e-08   4.09531919e-08
   7.66194782e-48]

In [20]:
# Zoom no plot entre a região 2150 e model[np.argmin(mean_elem)] = 2225
plt.plot(models, mean_elem)
plt.xlim(2150, minimo-50)


Out[20]:
(2150, 2175.0)

In [28]:
print mean_elem[2173], mean_elem[2174] 
# a posição no vetor que armazena a informação é sempre um número anterior, pois o vetor começa em zero
# então a posição mean_elem[2174] é referente ao modelo 2175
# Porém, ao procurar pelo número do modelo ao utilizar o NuGridPy, tenho que usar o numero exato do modelo, e não um número anterior


0.173468351762 4.09531919037e-08

In [45]:
# plot do HRD
t = s.get('log_Teff')
L = s.get('log_L')
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[2174], L[2174], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)
plt.savefig('hrd_alpha2_dot.png')



In [5]:
# Graficos de abundancia para antes e depois de perder o H (model 2174 e 2175)
# %run ~/Documents/mesa/codes/plot_abundance_at_model.py /media/glauffer/Data/mesa/alpha2_r8845/LOGS antes_de_perder_H abun_2174 2174 .
#import matplotlib.pyplot as plt
#%matplotlib inline
%run ~/Dropbox/UFRGS/kepler/mesa/mesa/codes/plot_abundance_at_model.py ~/Dropbox/UFRGS/kepler/mesa/alpha2 antes_de_perder_H abun_2174 2174 .


Using old history.datasa file ...
 reading ...100% 

58 in profiles.index file ...
Found and load nearest profile for cycle 2150
reading /home/glauffer/Dropbox/UFRGS/kepler/mesa/alpha2/profile49.data ...
 reading ...100% 

Closing history.data  tool ...
Closing profile tool ...
/home/glauffer/Dropbox/UFRGS/kepler/mesa/mesa/codes/plot_abundance_at_model.py:40: RuntimeWarning: divide by zero encountered in log
  x = - np.log(1 - q)

In [16]:
from IPython.display import Image
Image(filename='abun_2174.png')


Out[16]:

In [6]:
#%run ~/Documents/mesa/codes/plot_abundance_at_model.py /media/glauffer/Data/mesa/alpha2_r8845/LOGS Sem_H abun_2175 2175 .
%run ~/Dropbox/UFRGS/kepler/mesa/mesa/codes/plot_abundance_at_model.py ~/Dropbox/UFRGS/kepler/mesa/alpha2 Sem_H abun_2175 2175 .


Using old history.datasa file ...
 reading ...100% 

58 in profiles.index file ...
Found and load nearest profile for cycle 2200
reading /home/glauffer/Dropbox/UFRGS/kepler/mesa/alpha2/profile50.data ...
 reading ...100% 

Closing history.data  tool ...
Closing profile tool ...
/home/glauffer/Dropbox/UFRGS/kepler/mesa/mesa/codes/plot_abundance_at_model.py:40: RuntimeWarning: divide by zero encountered in log
  x = - np.log(1 - q)

In [17]:
Image(filename='abun_2175.png')


Out[17]:

Massa do núcleo de Helio apos H burn


In [1]:
# Procurando pelo parametro he_core
import mesa as ms
import numpy as np
folder2 = '/home/glauffer/Dropbox/UFRGS/kepler/mesa/alpha2/'
s = ms.history_data(folder2)


Using old history.datasa file ...
 reading ...100% 


In [2]:
s.cols


Out[2]:
{'burn_qtop_1': 156,
 'burn_qtop_10': 174,
 'burn_qtop_11': 176,
 'burn_qtop_12': 178,
 'burn_qtop_13': 180,
 'burn_qtop_14': 182,
 'burn_qtop_15': 184,
 'burn_qtop_16': 186,
 'burn_qtop_17': 188,
 'burn_qtop_18': 190,
 'burn_qtop_19': 192,
 'burn_qtop_2': 158,
 'burn_qtop_20': 194,
 'burn_qtop_21': 196,
 'burn_qtop_22': 198,
 'burn_qtop_23': 200,
 'burn_qtop_24': 202,
 'burn_qtop_25': 204,
 'burn_qtop_26': 206,
 'burn_qtop_27': 208,
 'burn_qtop_28': 210,
 'burn_qtop_29': 212,
 'burn_qtop_3': 160,
 'burn_qtop_30': 214,
 'burn_qtop_31': 216,
 'burn_qtop_32': 218,
 'burn_qtop_33': 220,
 'burn_qtop_34': 222,
 'burn_qtop_35': 224,
 'burn_qtop_36': 226,
 'burn_qtop_37': 228,
 'burn_qtop_38': 230,
 'burn_qtop_39': 232,
 'burn_qtop_4': 162,
 'burn_qtop_40': 234,
 'burn_qtop_41': 236,
 'burn_qtop_42': 238,
 'burn_qtop_43': 240,
 'burn_qtop_44': 242,
 'burn_qtop_45': 244,
 'burn_qtop_46': 246,
 'burn_qtop_47': 248,
 'burn_qtop_48': 250,
 'burn_qtop_49': 252,
 'burn_qtop_5': 164,
 'burn_qtop_50': 254,
 'burn_qtop_51': 256,
 'burn_qtop_52': 258,
 'burn_qtop_53': 260,
 'burn_qtop_54': 262,
 'burn_qtop_55': 264,
 'burn_qtop_56': 266,
 'burn_qtop_57': 268,
 'burn_qtop_58': 270,
 'burn_qtop_59': 272,
 'burn_qtop_6': 166,
 'burn_qtop_60': 274,
 'burn_qtop_61': 276,
 'burn_qtop_62': 278,
 'burn_qtop_63': 280,
 'burn_qtop_64': 282,
 'burn_qtop_65': 284,
 'burn_qtop_66': 286,
 'burn_qtop_67': 288,
 'burn_qtop_68': 290,
 'burn_qtop_69': 292,
 'burn_qtop_7': 168,
 'burn_qtop_70': 294,
 'burn_qtop_71': 296,
 'burn_qtop_72': 298,
 'burn_qtop_73': 300,
 'burn_qtop_74': 302,
 'burn_qtop_75': 304,
 'burn_qtop_76': 306,
 'burn_qtop_77': 308,
 'burn_qtop_78': 310,
 'burn_qtop_79': 312,
 'burn_qtop_8': 170,
 'burn_qtop_80': 314,
 'burn_qtop_9': 172,
 'burn_type_1': 155,
 'burn_type_10': 173,
 'burn_type_11': 175,
 'burn_type_12': 177,
 'burn_type_13': 179,
 'burn_type_14': 181,
 'burn_type_15': 183,
 'burn_type_16': 185,
 'burn_type_17': 187,
 'burn_type_18': 189,
 'burn_type_19': 191,
 'burn_type_2': 157,
 'burn_type_20': 193,
 'burn_type_21': 195,
 'burn_type_22': 197,
 'burn_type_23': 199,
 'burn_type_24': 201,
 'burn_type_25': 203,
 'burn_type_26': 205,
 'burn_type_27': 207,
 'burn_type_28': 209,
 'burn_type_29': 211,
 'burn_type_3': 159,
 'burn_type_30': 213,
 'burn_type_31': 215,
 'burn_type_32': 217,
 'burn_type_33': 219,
 'burn_type_34': 221,
 'burn_type_35': 223,
 'burn_type_36': 225,
 'burn_type_37': 227,
 'burn_type_38': 229,
 'burn_type_39': 231,
 'burn_type_4': 161,
 'burn_type_40': 233,
 'burn_type_41': 235,
 'burn_type_42': 237,
 'burn_type_43': 239,
 'burn_type_44': 241,
 'burn_type_45': 243,
 'burn_type_46': 245,
 'burn_type_47': 247,
 'burn_type_48': 249,
 'burn_type_49': 251,
 'burn_type_5': 163,
 'burn_type_50': 253,
 'burn_type_51': 255,
 'burn_type_52': 257,
 'burn_type_53': 259,
 'burn_type_54': 261,
 'burn_type_55': 263,
 'burn_type_56': 265,
 'burn_type_57': 267,
 'burn_type_58': 269,
 'burn_type_59': 271,
 'burn_type_6': 165,
 'burn_type_60': 273,
 'burn_type_61': 275,
 'burn_type_62': 277,
 'burn_type_63': 279,
 'burn_type_64': 281,
 'burn_type_65': 283,
 'burn_type_66': 285,
 'burn_type_67': 287,
 'burn_type_68': 289,
 'burn_type_69': 291,
 'burn_type_7': 167,
 'burn_type_70': 293,
 'burn_type_71': 295,
 'burn_type_72': 297,
 'burn_type_73': 299,
 'burn_type_74': 301,
 'burn_type_75': 303,
 'burn_type_76': 305,
 'burn_type_77': 307,
 'burn_type_78': 309,
 'burn_type_79': 311,
 'burn_type_8': 169,
 'burn_type_80': 313,
 'burn_type_9': 171,
 'c_core_mass': 26,
 'center_ar36': 64,
 'center_c12': 58,
 'center_ca40': 65,
 'center_cr56': 69,
 'center_entropy': 51,
 'center_fe54': 66,
 'center_fe56': 67,
 'center_h1': 56,
 'center_he4': 57,
 'center_n14': 59,
 'center_ne20': 61,
 'center_ni56': 68,
 'center_o16': 60,
 'center_omega': 48,
 'center_omega_div_omega_crit': 49,
 'center_s32': 63,
 'center_si28': 62,
 'center_ye': 50,
 'conv_mx1_bot': 10,
 'conv_mx1_top': 9,
 'conv_mx2_bot': 12,
 'conv_mx2_top': 11,
 'epsnuc_M_1': 17,
 'epsnuc_M_2': 18,
 'epsnuc_M_3': 19,
 'epsnuc_M_4': 20,
 'epsnuc_M_5': 21,
 'epsnuc_M_6': 22,
 'epsnuc_M_7': 23,
 'epsnuc_M_8': 24,
 'fe_core_mass': 29,
 'he_core_mass': 25,
 'kh_timescale': 30,
 'log_L': 33,
 'log_LH': 31,
 'log_LHe': 32,
 'log_R': 35,
 'log_Teff': 34,
 'log_abs_mdot': 4,
 'log_average_h1': 70,
 'log_average_h2': 71,
 'log_average_he3': 72,
 'log_average_he4': 73,
 'log_average_li7': 74,
 'log_center_P': 47,
 'log_center_Rho': 46,
 'log_center_T': 45,
 'log_dt': 6,
 'log_g': 36,
 'log_rotational_mdot_boost': 5,
 'log_total_angular_momentum': 8,
 'mix_qtop_1': 76,
 'mix_qtop_10': 94,
 'mix_qtop_11': 96,
 'mix_qtop_12': 98,
 'mix_qtop_13': 100,
 'mix_qtop_14': 102,
 'mix_qtop_15': 104,
 'mix_qtop_16': 106,
 'mix_qtop_17': 108,
 'mix_qtop_18': 110,
 'mix_qtop_19': 112,
 'mix_qtop_2': 78,
 'mix_qtop_20': 114,
 'mix_qtop_21': 116,
 'mix_qtop_22': 118,
 'mix_qtop_23': 120,
 'mix_qtop_24': 122,
 'mix_qtop_25': 124,
 'mix_qtop_26': 126,
 'mix_qtop_27': 128,
 'mix_qtop_28': 130,
 'mix_qtop_29': 132,
 'mix_qtop_3': 80,
 'mix_qtop_30': 134,
 'mix_qtop_31': 136,
 'mix_qtop_32': 138,
 'mix_qtop_33': 140,
 'mix_qtop_34': 142,
 'mix_qtop_35': 144,
 'mix_qtop_36': 146,
 'mix_qtop_37': 148,
 'mix_qtop_38': 150,
 'mix_qtop_39': 152,
 'mix_qtop_4': 82,
 'mix_qtop_40': 154,
 'mix_qtop_5': 84,
 'mix_qtop_6': 86,
 'mix_qtop_7': 88,
 'mix_qtop_8': 90,
 'mix_qtop_9': 92,
 'mix_type_1': 75,
 'mix_type_10': 93,
 'mix_type_11': 95,
 'mix_type_12': 97,
 'mix_type_13': 99,
 'mix_type_14': 101,
 'mix_type_15': 103,
 'mix_type_16': 105,
 'mix_type_17': 107,
 'mix_type_18': 109,
 'mix_type_19': 111,
 'mix_type_2': 77,
 'mix_type_20': 113,
 'mix_type_21': 115,
 'mix_type_22': 117,
 'mix_type_23': 119,
 'mix_type_24': 121,
 'mix_type_25': 123,
 'mix_type_26': 125,
 'mix_type_27': 127,
 'mix_type_28': 129,
 'mix_type_29': 131,
 'mix_type_3': 79,
 'mix_type_30': 133,
 'mix_type_31': 135,
 'mix_type_32': 137,
 'mix_type_33': 139,
 'mix_type_34': 141,
 'mix_type_35': 143,
 'mix_type_36': 145,
 'mix_type_37': 147,
 'mix_type_38': 149,
 'mix_type_39': 151,
 'mix_type_4': 81,
 'mix_type_40': 153,
 'mix_type_5': 83,
 'mix_type_6': 85,
 'mix_type_7': 87,
 'mix_type_8': 89,
 'mix_type_9': 91,
 'model_number': 1,
 'mx1_bot': 14,
 'mx1_top': 13,
 'mx2_bot': 16,
 'mx2_top': 15,
 'num_backups': 317,
 'num_retries': 316,
 'num_zones': 7,
 'o_core_mass': 27,
 'si_core_mass': 28,
 'star_age': 2,
 'star_mass': 3,
 'surf_avg_Lrad_div_Ledd': 44,
 'surf_avg_j_rot': 37,
 'surf_avg_omega': 38,
 'surf_avg_omega_crit': 39,
 'surf_avg_omega_div_omega_crit': 40,
 'surf_avg_v_crit': 42,
 'surf_avg_v_div_v_crit': 43,
 'surf_avg_v_rot': 41,
 'surface_c12': 53,
 'surface_he4': 52,
 'surface_n14': 54,
 'surface_o16': 55,
 'v_div_csound_surf': 315}

In [3]:
he = s.get('he_core_mass')
model = s.get('model_number')

In [72]:
%matplotlib inline
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(15., 10.))
plt.plot(model, he, 'go')
plt.plot(model, he, 'g-')
plt.title(r'$He$ core mass vs Model', fontsize=18)
plt.xlabel(r'Model', fontsize=16)
plt.ylabel(r'$He$ core mass', fontsize=16)
#plt.xlim(59,80)
#plt.plot(model[76], he[76], 'ro')
plt.xlim(50,100)
#plt.savefig('he_core_mass.png')
plt.savefig('he_core_mass_zoom.png')
print he[75], he[76]


0.0 1.11561482973

In [8]:
t = s.get('log_Teff')
L = s.get('log_L')
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[76], L[76], 'go')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)
plt.savefig('hrd_alpha2_he.png')



In [70]:
%matplotlib inline
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[60], L[60], 'ko')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$, posicao 60', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)
plt.xlim(4.2,4.5)
plt.ylim(3.5,3.8)
#plt.savefig('hrd_alpha2_he_model60.png')
plt.savefig('hrd_alpha2_he_model60_zoom.png')
#plt.show()



In [27]:
che4 = s.get('center_he4')
ch1 = s.get('center_h1')

In [41]:
plt.plot(model, che4, 'bo')
#plt.xlim(70,80)
#plt.plot(model, ch1, 'bo')
#plt.xlim(50,80)


Out[41]:
[<matplotlib.lines.Line2D at 0x7f41c5c5c9d0>]

In [53]:
a = ms.mesa_profile(folder2,60)


58 in profiles.index file ...
Found and load nearest profile for cycle 70
reading /home/glauffer/Dropbox/UFRGS/kepler/mesa/alpha2//profile3.data ...
 reading ...100% 

Closing profile tool ...

In [43]:
a.cols


Out[43]:
{'abar': 29,
 'am_log_D_DSI': 117,
 'am_log_D_ES': 120,
 'am_log_D_GSF': 121,
 'am_log_D_SH': 118,
 'am_log_D_SSI': 119,
 'am_log_D_ST': 122,
 'am_log_nu_ST': 123,
 'am_log_sig': 116,
 'burn_ar': 86,
 'burn_c': 78,
 'burn_ca': 87,
 'burn_cr': 89,
 'burn_fe': 90,
 'burn_mg': 83,
 'burn_n': 79,
 'burn_na': 82,
 'burn_ne': 81,
 'burn_o': 80,
 'burn_s': 85,
 'burn_si': 84,
 'burn_ti': 88,
 'c12': 62,
 'c12_c12': 91,
 'c12_o16': 92,
 'c13': 63,
 'cno': 76,
 'conv_vel_div_csound': 44,
 'csound': 11,
 'dlnT_dt': 55,
 'dlnd_dt': 54,
 'dq_ratio': 18,
 'dynamo_log_B_phi': 125,
 'dynamo_log_B_r': 124,
 'entropy': 9,
 'eps_grav': 34,
 'eps_nuc': 32,
 'eta': 15,
 'f19': 70,
 'fp_rot': 106,
 'free_e': 28,
 'ft_rot': 107,
 'gradL': 51,
 'gradT': 47,
 'gradT_sub_grada': 37,
 'grad_density': 50,
 'grad_temperature': 49,
 'grada': 27,
 'gradr': 48,
 'gradr_sub_grada': 126,
 'h1': 59,
 'he3': 60,
 'he4': 61,
 'i_rot': 104,
 'j_rot': 105,
 'ledoux_stable': 53,
 'logL': 7,
 'logP': 4,
 'logPgas': 26,
 'logR': 5,
 'logRho': 3,
 'logT': 2,
 'log_D_conv': 38,
 'log_D_mix': 42,
 'log_D_ovr': 40,
 'log_D_semi': 39,
 'log_D_thrm': 41,
 'log_J_div_M53': 100,
 'log_J_inside': 101,
 'log_abs_shear': 102,
 'log_am_nu': 108,
 'log_conv_vel': 43,
 'log_j_rot': 99,
 'log_mlt_D_mix': 45,
 'log_omega': 98,
 'log_opacity': 31,
 'log_r_equatorial': 112,
 'log_r_polar': 110,
 'logdq': 17,
 'logtau': 23,
 'logxq': 58,
 'luminosity': 6,
 'mass': 56,
 'mg24': 73,
 'mixing_type': 10,
 'mlt_mixing_length': 35,
 'mlt_mixing_type': 36,
 'mmid': 57,
 'mu': 16,
 'n13': 64,
 'n14': 65,
 'n15': 66,
 'ne20': 71,
 'ne22': 72,
 'non_nuc_neu': 33,
 'o16': 67,
 'o16_o16': 93,
 'o17': 68,
 'o18': 69,
 'omega': 97,
 'omega_crit': 114,
 'omega_div_omega_crit': 115,
 'other': 96,
 'pgas_div_ptotal': 25,
 'photo': 95,
 'pnhe4': 94,
 'pp': 75,
 'pressure': 24,
 'pressure_scale_height': 46,
 'q': 19,
 'r_e_div_r_p': 113,
 'r_equatorial': 111,
 'r_polar': 109,
 'radius': 20,
 'sch_stable': 52,
 'si28': 74,
 'tau': 22,
 'temperature': 21,
 'total_energy': 13,
 'tri_alfa': 77,
 'v_div_csound': 12,
 'v_div_r': 14,
 'v_rot': 103,
 'velocity': 8,
 'ye': 30,
 'zone': 1}

In [54]:
he3 = a.get('he3')
he4 = a.get('he4')
q = -np.log(1-a.get('q'))

In [71]:
#plt.plot(q, he3, 'b-')
plt.plot(q, he4, 'r-')


Out[71]:
[<matplotlib.lines.Line2D at 0x7f41c6065e50>]

Identificando a posicao antes e depois dos pulsos termicos


In [1]:
# Lendo os dados do MESA
import mesa as ms
folder2 = '/home/glauffer/Dropbox/UFRGS/kepler/mesa/alpha2/'
s = ms.history_data(folder2)
models = s.get('model_number')
#s.cols()


Using old history.datasa file ...
 reading ...100% 


In [5]:
s.cols


Out[5]:
{'burn_qtop_1': 156,
 'burn_qtop_10': 174,
 'burn_qtop_11': 176,
 'burn_qtop_12': 178,
 'burn_qtop_13': 180,
 'burn_qtop_14': 182,
 'burn_qtop_15': 184,
 'burn_qtop_16': 186,
 'burn_qtop_17': 188,
 'burn_qtop_18': 190,
 'burn_qtop_19': 192,
 'burn_qtop_2': 158,
 'burn_qtop_20': 194,
 'burn_qtop_21': 196,
 'burn_qtop_22': 198,
 'burn_qtop_23': 200,
 'burn_qtop_24': 202,
 'burn_qtop_25': 204,
 'burn_qtop_26': 206,
 'burn_qtop_27': 208,
 'burn_qtop_28': 210,
 'burn_qtop_29': 212,
 'burn_qtop_3': 160,
 'burn_qtop_30': 214,
 'burn_qtop_31': 216,
 'burn_qtop_32': 218,
 'burn_qtop_33': 220,
 'burn_qtop_34': 222,
 'burn_qtop_35': 224,
 'burn_qtop_36': 226,
 'burn_qtop_37': 228,
 'burn_qtop_38': 230,
 'burn_qtop_39': 232,
 'burn_qtop_4': 162,
 'burn_qtop_40': 234,
 'burn_qtop_41': 236,
 'burn_qtop_42': 238,
 'burn_qtop_43': 240,
 'burn_qtop_44': 242,
 'burn_qtop_45': 244,
 'burn_qtop_46': 246,
 'burn_qtop_47': 248,
 'burn_qtop_48': 250,
 'burn_qtop_49': 252,
 'burn_qtop_5': 164,
 'burn_qtop_50': 254,
 'burn_qtop_51': 256,
 'burn_qtop_52': 258,
 'burn_qtop_53': 260,
 'burn_qtop_54': 262,
 'burn_qtop_55': 264,
 'burn_qtop_56': 266,
 'burn_qtop_57': 268,
 'burn_qtop_58': 270,
 'burn_qtop_59': 272,
 'burn_qtop_6': 166,
 'burn_qtop_60': 274,
 'burn_qtop_61': 276,
 'burn_qtop_62': 278,
 'burn_qtop_63': 280,
 'burn_qtop_64': 282,
 'burn_qtop_65': 284,
 'burn_qtop_66': 286,
 'burn_qtop_67': 288,
 'burn_qtop_68': 290,
 'burn_qtop_69': 292,
 'burn_qtop_7': 168,
 'burn_qtop_70': 294,
 'burn_qtop_71': 296,
 'burn_qtop_72': 298,
 'burn_qtop_73': 300,
 'burn_qtop_74': 302,
 'burn_qtop_75': 304,
 'burn_qtop_76': 306,
 'burn_qtop_77': 308,
 'burn_qtop_78': 310,
 'burn_qtop_79': 312,
 'burn_qtop_8': 170,
 'burn_qtop_80': 314,
 'burn_qtop_9': 172,
 'burn_type_1': 155,
 'burn_type_10': 173,
 'burn_type_11': 175,
 'burn_type_12': 177,
 'burn_type_13': 179,
 'burn_type_14': 181,
 'burn_type_15': 183,
 'burn_type_16': 185,
 'burn_type_17': 187,
 'burn_type_18': 189,
 'burn_type_19': 191,
 'burn_type_2': 157,
 'burn_type_20': 193,
 'burn_type_21': 195,
 'burn_type_22': 197,
 'burn_type_23': 199,
 'burn_type_24': 201,
 'burn_type_25': 203,
 'burn_type_26': 205,
 'burn_type_27': 207,
 'burn_type_28': 209,
 'burn_type_29': 211,
 'burn_type_3': 159,
 'burn_type_30': 213,
 'burn_type_31': 215,
 'burn_type_32': 217,
 'burn_type_33': 219,
 'burn_type_34': 221,
 'burn_type_35': 223,
 'burn_type_36': 225,
 'burn_type_37': 227,
 'burn_type_38': 229,
 'burn_type_39': 231,
 'burn_type_4': 161,
 'burn_type_40': 233,
 'burn_type_41': 235,
 'burn_type_42': 237,
 'burn_type_43': 239,
 'burn_type_44': 241,
 'burn_type_45': 243,
 'burn_type_46': 245,
 'burn_type_47': 247,
 'burn_type_48': 249,
 'burn_type_49': 251,
 'burn_type_5': 163,
 'burn_type_50': 253,
 'burn_type_51': 255,
 'burn_type_52': 257,
 'burn_type_53': 259,
 'burn_type_54': 261,
 'burn_type_55': 263,
 'burn_type_56': 265,
 'burn_type_57': 267,
 'burn_type_58': 269,
 'burn_type_59': 271,
 'burn_type_6': 165,
 'burn_type_60': 273,
 'burn_type_61': 275,
 'burn_type_62': 277,
 'burn_type_63': 279,
 'burn_type_64': 281,
 'burn_type_65': 283,
 'burn_type_66': 285,
 'burn_type_67': 287,
 'burn_type_68': 289,
 'burn_type_69': 291,
 'burn_type_7': 167,
 'burn_type_70': 293,
 'burn_type_71': 295,
 'burn_type_72': 297,
 'burn_type_73': 299,
 'burn_type_74': 301,
 'burn_type_75': 303,
 'burn_type_76': 305,
 'burn_type_77': 307,
 'burn_type_78': 309,
 'burn_type_79': 311,
 'burn_type_8': 169,
 'burn_type_80': 313,
 'burn_type_9': 171,
 'c_core_mass': 26,
 'center_ar36': 64,
 'center_c12': 58,
 'center_ca40': 65,
 'center_cr56': 69,
 'center_entropy': 51,
 'center_fe54': 66,
 'center_fe56': 67,
 'center_h1': 56,
 'center_he4': 57,
 'center_n14': 59,
 'center_ne20': 61,
 'center_ni56': 68,
 'center_o16': 60,
 'center_omega': 48,
 'center_omega_div_omega_crit': 49,
 'center_s32': 63,
 'center_si28': 62,
 'center_ye': 50,
 'conv_mx1_bot': 10,
 'conv_mx1_top': 9,
 'conv_mx2_bot': 12,
 'conv_mx2_top': 11,
 'epsnuc_M_1': 17,
 'epsnuc_M_2': 18,
 'epsnuc_M_3': 19,
 'epsnuc_M_4': 20,
 'epsnuc_M_5': 21,
 'epsnuc_M_6': 22,
 'epsnuc_M_7': 23,
 'epsnuc_M_8': 24,
 'fe_core_mass': 29,
 'he_core_mass': 25,
 'kh_timescale': 30,
 'log_L': 33,
 'log_LH': 31,
 'log_LHe': 32,
 'log_R': 35,
 'log_Teff': 34,
 'log_abs_mdot': 4,
 'log_average_h1': 70,
 'log_average_h2': 71,
 'log_average_he3': 72,
 'log_average_he4': 73,
 'log_average_li7': 74,
 'log_center_P': 47,
 'log_center_Rho': 46,
 'log_center_T': 45,
 'log_dt': 6,
 'log_g': 36,
 'log_rotational_mdot_boost': 5,
 'log_total_angular_momentum': 8,
 'mix_qtop_1': 76,
 'mix_qtop_10': 94,
 'mix_qtop_11': 96,
 'mix_qtop_12': 98,
 'mix_qtop_13': 100,
 'mix_qtop_14': 102,
 'mix_qtop_15': 104,
 'mix_qtop_16': 106,
 'mix_qtop_17': 108,
 'mix_qtop_18': 110,
 'mix_qtop_19': 112,
 'mix_qtop_2': 78,
 'mix_qtop_20': 114,
 'mix_qtop_21': 116,
 'mix_qtop_22': 118,
 'mix_qtop_23': 120,
 'mix_qtop_24': 122,
 'mix_qtop_25': 124,
 'mix_qtop_26': 126,
 'mix_qtop_27': 128,
 'mix_qtop_28': 130,
 'mix_qtop_29': 132,
 'mix_qtop_3': 80,
 'mix_qtop_30': 134,
 'mix_qtop_31': 136,
 'mix_qtop_32': 138,
 'mix_qtop_33': 140,
 'mix_qtop_34': 142,
 'mix_qtop_35': 144,
 'mix_qtop_36': 146,
 'mix_qtop_37': 148,
 'mix_qtop_38': 150,
 'mix_qtop_39': 152,
 'mix_qtop_4': 82,
 'mix_qtop_40': 154,
 'mix_qtop_5': 84,
 'mix_qtop_6': 86,
 'mix_qtop_7': 88,
 'mix_qtop_8': 90,
 'mix_qtop_9': 92,
 'mix_type_1': 75,
 'mix_type_10': 93,
 'mix_type_11': 95,
 'mix_type_12': 97,
 'mix_type_13': 99,
 'mix_type_14': 101,
 'mix_type_15': 103,
 'mix_type_16': 105,
 'mix_type_17': 107,
 'mix_type_18': 109,
 'mix_type_19': 111,
 'mix_type_2': 77,
 'mix_type_20': 113,
 'mix_type_21': 115,
 'mix_type_22': 117,
 'mix_type_23': 119,
 'mix_type_24': 121,
 'mix_type_25': 123,
 'mix_type_26': 125,
 'mix_type_27': 127,
 'mix_type_28': 129,
 'mix_type_29': 131,
 'mix_type_3': 79,
 'mix_type_30': 133,
 'mix_type_31': 135,
 'mix_type_32': 137,
 'mix_type_33': 139,
 'mix_type_34': 141,
 'mix_type_35': 143,
 'mix_type_36': 145,
 'mix_type_37': 147,
 'mix_type_38': 149,
 'mix_type_39': 151,
 'mix_type_4': 81,
 'mix_type_40': 153,
 'mix_type_5': 83,
 'mix_type_6': 85,
 'mix_type_7': 87,
 'mix_type_8': 89,
 'mix_type_9': 91,
 'model_number': 1,
 'mx1_bot': 14,
 'mx1_top': 13,
 'mx2_bot': 16,
 'mx2_top': 15,
 'num_backups': 317,
 'num_retries': 316,
 'num_zones': 7,
 'o_core_mass': 27,
 'si_core_mass': 28,
 'star_age': 2,
 'star_mass': 3,
 'surf_avg_Lrad_div_Ledd': 44,
 'surf_avg_j_rot': 37,
 'surf_avg_omega': 38,
 'surf_avg_omega_crit': 39,
 'surf_avg_omega_div_omega_crit': 40,
 'surf_avg_v_crit': 42,
 'surf_avg_v_div_v_crit': 43,
 'surf_avg_v_rot': 41,
 'surface_c12': 53,
 'surface_he4': 52,
 'surface_n14': 54,
 'surface_o16': 55,
 'v_div_csound_surf': 315}

In [1]:
# Identificando os pulsos termicos utilizand a luminosidade de He versus o numero do modelo (log(he) X model)
import matplotlib.pyplot as plt
%matplotlib inline
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, s.get('log_LHe'))
plt.title(r'$\log(He)$ vs model $n$')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-6352ffc15d1a> in <module>()
      4 plt.rcParams["figure.figsize"] = (15., 10.)
      5 #fig = plt.figure(figsize=(15., 10.))
----> 6 plt.plot(models, s.get('log_LHe'))
      7 plt.title(r'$\log(He)$ vs model $n$')

NameError: name 'models' is not defined

In [16]:
# os picos comecam apos o modelo 2250. Vou dar um zoom do grafico para identificar com mais precisao
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, s.get('log_LHe'))
#plt.plot(s.get('star_age'), s.get('log_LHe'))
plt.title(r'$\log(He)$ vs model $n$')
plt.plot(models[2349], s.get('log_LHe')[2349], 'ro')
plt.plot(models[2524], s.get('log_LHe')[2524], 'ro')
#plt.plot(s.get('star_age')[2349], s.get('log_LHe')[2349], 'ro')
#plt.plot(s.get('star_age')[2524], s.get('log_LHe')[2524], 'ro')
#plt.xlim(2250,2600)
#plt.xlim(2.5e7,3e7)


Out[16]:
[<matplotlib.lines.Line2D at 0x7f92677eb710>]

In [5]:
# Vou plotar o HRD com um ponto no modelo 2350 e 2550
t = s.get('log_Teff')
L = s.get('log_L')
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[2349], L[2349], 'ro')
plt.plot(t[2524], L[2524], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)


Out[5]:
<matplotlib.text.Text at 0x7f9274059ed0>

In [20]:
# errado.. os pulsos sao bem antes...
# vou pegar a primeira variacao na luminosidade do he
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, s.get('log_LHe'))
plt.title(r'$\log(He)$ vs model $n$')
plt.plot(models[49], s.get('log_LHe')[49], 'ro')
plt.plot(models[179], s.get('log_LHe')[179], 'ro')
plt.xlim(0,200)


Out[20]:
(0, 200)

In [21]:
#novamente, plotar o HRD com pontos nos modelos 50 e 150

fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[49], L[49], 'go')
plt.plot(t[179], L[179], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)


Out[21]:
<matplotlib.text.Text at 0x7f4742674c10>

In [27]:
# tambem nao... deve ser a pequena variacao apos o modelo 180
# identificando essa pequena variacao
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, s.get('log_LHe'))
plt.title(r'$\log(He)$ vs model $n$')
plt.plot(models[449], s.get('log_LHe')[449], 'ro')
plt.plot(models[179], s.get('log_LHe')[179], 'go')
plt.plot(models[349], s.get('log_LHe')[349], 'ko')
plt.xlim(0,800)


Out[27]:
(0, 800)

In [28]:
# fazendo o HRD com pontos nos modelos 350 e 450
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[349], L[349], 'go')
plt.plot(t[449], L[449], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$', fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)


Out[28]:
<matplotlib.text.Text at 0x7f4742665350>

In [63]:
#tambem nao... vou chutar valores no HRD
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[2089], L[2089], 'go')
plt.plot(t[499], L[499], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$ , $M_f = $' + str(mass[-1]), fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)


Out[63]:
<matplotlib.text.Text at 0x7f473cf7ec90>

In [103]:
# analisando os modelos 500 e 2090 na luminosidade do helio
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, s.get('log_LHe'))
plt.title(r'$\log L_{He}$ vs model $n$', fontsize=18)
plt.xlabel('model', fontsize=16)
plt.ylabel(r'$\log L_{He}$', fontsize=16)
plt.plot(models[499], s.get('log_LHe')[499], 'ro')
plt.plot(models[2089], s.get('log_LHe')[2089], 'go')
#plt.plot(models[349], s.get('log_LHe')[349], 'ko')
#plt.xlim(0,800)
plt.savefig('log_L_he.png')



In [47]:
# identifiquei como 'pulsos termicos' a regiao entre os modelos 500 e 2090.
# vou analisar a variacao de massa nesse intervalo
fig = plt.figure(figsize=(15., 10.))
mass = s.get('star_mass')
plt.plot(models, mass)
plt.plot(models[499], mass[499], 'ro')
plt.plot(models[2089], mass[2089], 'go')
print 'M modelo 500: ', mass[499]
print 'M modelo 2089: ', mass[2089]
print 'variacao de massa entre modelos 500 e 2090: ', abs(mass[2089] - mass[499])


M modelo 500:  7.88791080294
M modelo 2089:  2.14423207174
variacao de massa entre modelos 500 e 2090:  5.7436787312

In [54]:
# ha um outro pico de perda de massa no grafico acima, apos o modelo 2200.
# identificando o modelo do pico
fig = plt.figure(figsize=(15., 10.))
plt.plot(models, mass)
plt.plot(models[2199], mass[2199], 'ro')
plt.plot(models[2329], mass[2329], 'go')
plt.xlim(2000, 2500)
print 'M modelo 2200: ', mass[2199]
print 'M modelo 2330: ', mass[2329]
print 'variacao de massa entre modelos 2200 e 2330: ', abs(mass[2199] - mass[2329])
print 'Massa final: ', mass[-1]


M modelo 2200:  2.02016541977
M modelo 2330:  1.03854214683
variacao de massa entre modelos 2200 e 2330:  0.981623272949
Massa final:  1.0326928373

In [101]:
#identificando os pontos de perda de massa do HRD e fazendo os plots com essa informacao
fig = plt.figure(figsize=(15., 10.))
plt.plot(t, L)
plt.plot(t[2089], L[2089], 'go')
plt.plot(t[499], L[499], 'ro')
plt.gca().invert_xaxis()
plt.title(r'HRD $\alpha_{MLT}=2$ , $M_f = $' + str(mass[-1]), fontsize=18)
plt.xlabel(r'$\log T_{Eff}$', fontsize=16)
plt.ylabel(r'$\log L$', fontsize=16)
plt.text(4.5, 3.0, 'model 500 (ponto vermelho): '+ str(mass[499]) + r'$M_\odot$')
plt.text(4.5, 2.9, 'model 2090 (ponto verde): '+ str(mass[2089]) + r'$M_\odot$')
plt.text(4.5, 2.8, 'model 2090 - model 500: '+ str(abs(mass[2089] - mass[499])) + r'$M_\odot$')

plt.plot(t[2199], L[2199], 'ko')
plt.plot(t[2329], L[2329], 'yo')
plt.text(4.5, 2.5, 'model 2200 (ponto preto): '+ str(mass[2199]) + r'$M_\odot$')
plt.text(4.5, 2.4, 'model 2330 (ponto amarelo): '+ str(mass[2329]) + r'$M_\odot$')
plt.text(4.5, 2.3, 'model 2330 - model 2200: '+ str(abs(mass[2199] - mass[2329])) + r'$M_\odot$')

plt.plot(t[2174], L[2174], 'kx')
plt.annotate('Perde H (modelo 2175)', xy=(t[2174], L[2174]), xytext=(t[2174], L[2174]+0.2),
            arrowprops=dict(facecolor='black', width = 1.5, headwidth = 10.0, shrink=0.15),)
            #)
plt.savefig('hrd_anotacoes_perda_massa.png')



In [113]:
# plotanto massa X model para imprimir
fig = plt.figure(figsize=(15., 10.))
#plt.plot(models, mass, 'b.')
plt.plot(models, mass)
plt.plot(models[499], mass[499], 'ro')
plt.plot(models[2089], mass[2089], 'go')
plt.plot(models[2199], mass[2199], 'ko')
plt.plot(models[2329], mass[2329], 'yo')
#plt.xlim(2000, 2500)
plt.title('Mass X model', fontsize=18)
plt.xlabel('model', fontsize=16)
plt.ylabel('Mass', fontsize=16)
plt.savefig('perda_de_massa.png')



In [ ]: